package com.glsc.ngateway.common.api.flowable.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@Builder
@NoArgsConstructor
@ToString
public class FlowFormEventImproveDto implements Serializable {

    @ApiModelProperty(value = "流程ID")
    private String processId;

    @ApiModelProperty(value = "流程标题")
    String processTitle;

    @ApiModelProperty(value = "整改流程由哪个整改措施触发")
    private Integer fromImproveId;

    @ApiModelProperty(value = "关联事件id")
    private String fromEventProcessId;

    @ApiModelProperty(value = "关联事件标题")
    private String fromEventProcessTitle;

    @ApiModelProperty(value = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime processCreateTime;

    @ApiModelProperty(value = "发起人部门名称")
    String flowCreatorDepartment;

    @ApiModelProperty(value = "流程创建人姓名")
    String flowCreateOperatorName;

    @ApiModelProperty(value = "流程创建人OA账号")
    String flowCreateOperatorAccount;

    @ApiModelProperty(value = "整改内容")
    private String improveContent;

    @ApiModelProperty(value = "整改负责人账号")
    String improvePersonList;

    @ApiModelProperty(value = "整改负责人姓名")
    String improvePersonNameList;

    @ApiModelProperty(value = "计划完成时间")
    protected String planDate;

    @ApiModelProperty(value = "实际完成时间")
    protected String finishDate;

    @ApiModelProperty(value = "整改状态")
    private String improveState;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    protected LocalDateTime insertTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    protected LocalDateTime updateTime;

    @Builder.Default
    @ApiModelProperty(value = "是否完成")
    private int isClose = 0;
}
